package com.white.androidstudy.ipc;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.white.androidstudy.R;
import com.white.androidstudy.bean.Page;
import com.white.androidstudy.bean.User;
import com.white.androidstudy.green.GreenDaoManager;
import com.white.androidstudy.widget.WaterRippleView;

public class MainActivity extends AppCompatActivity
{

    WaterRippleView wa;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        wa = (WaterRippleView) findViewById(R.id.wa);
//        startService(new Intent(this, BookManagerService.class));
//        startActivity(new Intent(this, ClientActivity.class));
//        finish();
    }

    public void click(View v)
    {
        wa.start();
        User a = new User(1L, "ytf", 25);
        GreenDaoManager.getInstance("db1.db")
                .getDaoSession()
                .getUserDao()
                .insert(a);
        Page p = new Page(1L, "only blank", 1);
        GreenDaoManager.getInstance("db2.db")
                .getDaoSession()
                .getPageDao()
                .insert(p);
    }
}
